﻿using Shop.Collect;
using Shop.RemoteModel;
using WeDonekRpc.Client.Interface;

namespace Shop.LocalEvent.Coupon
{
    internal class ClearCouponEvent : IEventHandler<CouponEvent>
    {
        private readonly ICouponGoodsCollect _Goods;

        public ClearCouponEvent (ICouponGoodsCollect goods)
        {
            this._Goods = goods;
        }

        public void HandleEvent (CouponEvent data, string eventName)
        {
            if (data.Coupon.PutInRange == CouponPutInRange.部分参与)
            {
                this._Goods.Clear(data.Coupon.Id);
            }
        }
    }
}
